package com.zhku.user.feignclient;


import com.zhku.base.model.RestResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class GoodsClientFactory implements FallbackFactory<GoodsClient> {
    @Override
    public GoodsClient create(Throwable throwable) {
        return new GoodsClient() {

            @Override
            public RestResponse<TtGoods> getGoods(String id) {
                log.debug("调用商品服务--查询当前商品信息熔断异常:{}", throwable.getMessage());
                return null;
            }
        };
    }
}
